package cn.lds.j368.dsbank.controller;

import cn.lds.j368.dsbank.domain.ProvinceCityDistrict;
import cn.lds.j368.dsbank.service.ProvinceCityDistrictService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 提供查询省市县的接口
 */
@RestController
@RequestMapping("/pcd")
public class ProvinceCityDistrictController {

    @Autowired
    private ProvinceCityDistrictService provinceCityDistrictService;

    @GetMapping("/query_pcd/{pid}")
    private List<ProvinceCityDistrict> selectProviceCityDistrict(@PathVariable Integer pid){
        return provinceCityDistrictService.selectPCDAllByPid(pid);
    }
}
